load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load(
    "@fbsource//xplat/folly:defs.bzl",
    "folly_xplat_library",
)
load("@fbsource//xplat/pfh/triage_InfrastructureSupermoduleOptou:DEFS.bzl", "triage_InfrastructureSupermoduleOptou")

oncall("fbcode_entropy_wardens_folly")

non_fbcode_target(
    _kind = folly_xplat_library,
    name = "contains",
    srcs = ["Contains.cpp"],
    feature = triage_InfrastructureSupermoduleOptou,
    raw_headers = ["Contains.h"],
    deps = [
        "//xplat/folly/algorithm/simd/detail:simd_contains_impl",
    ],
    exported_deps = [
        "//xplat/folly/algorithm/simd/detail:traits",
    ],
)

non_fbcode_target(
    _kind = folly_xplat_library,
    name = "find_first_of",
    feature = triage_InfrastructureSupermoduleOptou,
    raw_headers = ["find_first_of.h"],
    deps = [
        "//xplat/folly:portability",
        "//xplat/folly:utility",
        "//xplat/folly/algorithm/simd:movemask",
        "//xplat/folly/container:span",
        "//xplat/folly/container:sparse_byte_set",
        "//xplat/folly/lang:align",
        "//xplat/folly/lang:bits",
        "//xplat/folly/lang:hint",
    ],
)

non_fbcode_target(
    _kind = folly_xplat_library,
    name = "find_first_of_extra",
    feature = triage_InfrastructureSupermoduleOptou,
    raw_headers = ["find_first_of_extra.h"],
    deps = [
        "//xplat/folly:range",
        "//xplat/folly/container:span",
    ],
)

non_fbcode_target(
    _kind = folly_xplat_library,
    name = "find_fixed",
    feature = triage_InfrastructureSupermoduleOptou,
    raw_headers = ["FindFixed.h"],
    deps = [
        "//xplat/folly:portability",
        "//xplat/folly/algorithm/simd:movemask",
        "//xplat/folly/algorithm/simd/detail:traits",
    ],
)

non_fbcode_target(
    _kind = folly_xplat_library,
    name = "ignore",
    feature = triage_InfrastructureSupermoduleOptou,
    raw_headers = ["Ignore.h"],
    deps = [
        "//xplat/folly:portability",
    ],
)

non_fbcode_target(
    _kind = folly_xplat_library,
    name = "movemask",
    feature = triage_InfrastructureSupermoduleOptou,
    raw_headers = ["Movemask.h"],
    deps = [
        "//xplat/folly:portability",
        "//xplat/folly/algorithm/simd:ignore",
    ],
)

# !!!! fbcode/folly/algorithm/simd/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!!

######################################################################
# Libraries

fbcode_target(
    _kind = cpp_library,
    name = "contains",
    srcs = ["Contains.cpp"],
    headers = ["Contains.h"],
    deps = [
        "//folly/algorithm/simd/detail:simd_contains_impl",
    ],
    exported_deps = [
        "//folly:c_portability",
        "//folly/algorithm/simd/detail:traits",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "find_first_of",
    headers = ["find_first_of.h"],
    exported_deps = [
        ":movemask",
        "//folly:portability",
        "//folly:utility",
        "//folly/container:span",
        "//folly/container:sparse_byte_set",
        "//folly/lang:align",
        "//folly/lang:bits",
        "//folly/lang:hint",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "find_first_of_extra",
    headers = ["find_first_of_extra.h"],
    exported_deps = [
        "//folly:range",
        "//folly/container:span",
    ],
    exported_external_deps = [
        "tbb",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "find_fixed",
    headers = ["FindFixed.h"],
    exported_deps = [
        ":movemask",
        "//folly:portability",
        "//folly/algorithm/simd/detail:traits",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "ignore",
    headers = ["Ignore.h"],
    exported_deps = [
        "//folly/lang:bits",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "movemask",
    headers = ["Movemask.h"],
    exported_deps = [
        ":ignore",
        "//folly:portability",
        "//folly/lang:bits",
    ],
)
